<template>
    <el-breadcrumb :separator-icon="ArrowRight">
        <el-breadcrumb-item  v-for="(item, index) in breadList" :key="item.path">
            <router-link to="/welcome" v-if="index==0">{{item.meta.title}}</router-link>
            <span v-else>{{item.meta.title}}</span>
        </el-breadcrumb-item>
    </el-breadcrumb>
</template>

<script>
import { ArrowRight } from '@element-plus/icons-vue'
import { markRaw } from 'vue'
export default {
    name: 'BreadCrumb',
    data() {
        return {
            ArrowRight: markRaw(ArrowRight)  // 将图标组件添加到 data 中,使用 markRaw 阻止响应式转换
        }
    },
    computed:{
        breadList() {
            return this.$route.matched;
        }
    }
};
</script>